package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MaterialCollectMapper;
import com.ruoyi.system.api.domain.MaterialCollect;
import com.ruoyi.system.service.IMaterialCollectService;

/**
 * 收藏记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-04
 */
@Service
public class MaterialCollectServiceImpl implements IMaterialCollectService 
{
    @Autowired
    private MaterialCollectMapper materialCollectMapper;

    /**
     * 查询收藏记录
     * 
     * @param id 收藏记录主键
     * @return 收藏记录
     */
    @Override
    public MaterialCollect selectMaterialCollectById(Long id)
    {
        return materialCollectMapper.selectMaterialCollectById(id);
    }

    /**
     * 查询收藏记录列表
     * 
     * @param materialCollect 收藏记录
     * @return 收藏记录
     */
    @Override
    public List<MaterialCollect> selectMaterialCollectList(MaterialCollect materialCollect)
    {
        return materialCollectMapper.selectMaterialCollectList(materialCollect);
    }

    /**
     * 新增收藏记录
     * 
     * @param materialCollect 收藏记录
     * @return 结果
     */
    @Override
    public int insertMaterialCollect(MaterialCollect materialCollect)
    {
        materialCollect.setCreateTime(DateUtils.getNowDate());
        return materialCollectMapper.insertMaterialCollect(materialCollect);
    }

    /**
     * 修改收藏记录
     * 
     * @param materialCollect 收藏记录
     * @return 结果
     */
    @Override
    public int updateMaterialCollect(MaterialCollect materialCollect)
    {
        return materialCollectMapper.updateMaterialCollect(materialCollect);
    }

    /**
     * 批量删除收藏记录
     * 
     * @param ids 需要删除的收藏记录主键
     * @return 结果
     */
    @Override
    public int deleteMaterialCollectByIds(Long[] ids)
    {
        return materialCollectMapper.deleteMaterialCollectByIds(ids);
    }

    /**
     * 删除收藏记录信息
     * 
     * @param id 收藏记录主键
     * @return 结果
     */
    @Override
    public int deleteMaterialCollectById(Long id)
    {
        return materialCollectMapper.deleteMaterialCollectById(id);
    }
}
